<!DOCTYPE html>
<html>

<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width,initial-scale=1.0'>
    <meta http-equiv='X-UA-Compatible' content='ie=edge'>
    <title>Document</title>
    <style>
        .active {
            color: red;
        }
    </style>
</head>

<body>
    <div id='app'>
        <p class="left" :class={active:isActive}>内容</p>
        <button @click="changeActive()">按钮</button>
    </div>
    <script src='./vue.js'></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                isActive: true
            },
            methods: {
                changeActive() {
                    this.isActive = !this.isActive;
                }
            }
        });
    </script>
</body>

</html>